<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>EOS.IO: Console C++ API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Console C++ API<div class="ingroups"><a class="el" href="group__contractdev.html">How To Write Contracts</a> &raquo; <a class="el" href="group__consoleapi.html">Console API</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>C++ wrapper for Console C API.  
<a href="#details">More...</a></p>
<div class="dynheader">
Collaboration diagram for Console C++ API:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__console_cppapi.png" border="0" alt="" usemap="#group____console__cppapi"/>
<map name="group____console__cppapi" id="group____console__cppapi">
<area shape="rect" id="node1" href="group__consoleapi.html" title="Enables applications to log/print text messages. " alt="" coords="5,5,101,32"/>
</map>
</td></tr></table></center>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1iostream.html">eosio::iostream</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga85e09598593e7c6e5334910c47f3bd44"><td class="memTemplParams" colspan="2">template&lt;typename Arg , typename... Args&gt; </td></tr>
<tr class="memitem:ga85e09598593e7c6e5334910c47f3bd44"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__console_cppapi.html#ga85e09598593e7c6e5334910c47f3bd44">eosio::print</a> (Arg a, Args...args)</td></tr>
<tr class="memdesc:ga85e09598593e7c6e5334910c47f3bd44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print out value / list of values.  <a href="group__console_cppapi.html#ga85e09598593e7c6e5334910c47f3bd44">More...</a><br /></td></tr>
<tr class="separator:ga85e09598593e7c6e5334910c47f3bd44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad4459f4a84575efe71fa3637298b8510"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:gad4459f4a84575efe71fa3637298b8510"><td class="memTemplItemLeft" align="right" valign="top">iostream &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__console_cppapi.html#gad4459f4a84575efe71fa3637298b8510">eosio::operator&lt;&lt;</a> (iostream &amp;out, const T &amp;v)</td></tr>
<tr class="memdesc:gad4459f4a84575efe71fa3637298b8510"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload c++ iostream.  <a href="group__console_cppapi.html#gad4459f4a84575efe71fa3637298b8510">More...</a><br /></td></tr>
<tr class="separator:gad4459f4a84575efe71fa3637298b8510"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This API uses C++ variadic templates and type detection to make it easy to print any native type. You can even overload the <code><a class="el" href="namespaceeos.html#a1df73defa04d39763089df7faa35a934" title="Prints string. ">print()</a></code> method for your own custom types.</p>
<p><b>Example:</b> </p><div class="fragment"><div class="line"><a class="code" href="namespaceeos.html#a1df73defa04d39763089df7faa35a934">print</a>( <span class="stringliteral">&quot;hello world, this is a number: &quot;</span>, 5 );</div></div><!-- fragment --><h1><a class="anchor" id="override"></a>
Overriding Print for your Types</h1>
<p>There are two ways to overload print:</p><ol type="1">
<li>implement void print( const T&amp; )</li>
<li>implement T::print()const </li>
</ol>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gad4459f4a84575efe71fa3637298b8510"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">iostream&amp; eosio::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classeos_1_1iostream.html">iostream</a> &amp;&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>v</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Overload c++ iostream </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">out</td><td>Output strem </td></tr>
    <tr><td class="paramname">v</td><td>Value to be printed</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span> *s = <span class="stringliteral">&quot;Hello World!&quot;</span>;</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> unsigned_64_bit_int = 1e+18;</div><div class="line"><a class="code" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> unsigned_128_bit_int (87654323456);</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> string_as_unsigned_64_bit = <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(abcde);</div><div class="line">std::out &lt;&lt; s &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; unsigned_64_bit_int &lt;&lt; <span class="stringliteral">&quot; &quot;</span>  &lt;&lt; unsigned_128_bit_int &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; string_as_unsigned_64_bit);</div><div class="line"><span class="comment">// Output: Hello World! 1000000000000000000 87654323456 abcde</span></div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga85e09598593e7c6e5334910c47f3bd44"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Arg , typename... Args&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void eosio::print </td>
          <td>(</td>
          <td class="paramtype">Arg&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Args...&#160;</td>
          <td class="paramname"><em>args</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Print out value / list of values (except double) </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Value to be printed </td></tr>
    <tr><td class="paramname">args</td><td>Other values to be printed</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><div class="fragment"><div class="line"><span class="keywordtype">char</span> *s = <span class="stringliteral">&quot;Hello World!&quot;</span>;</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> unsigned_64_bit_int = 1e+18;</div><div class="line"><a class="code" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> unsigned_128_bit_int (87654323456);</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> string_as_unsigned_64_bit = <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(abcde);</div><div class="line"><a class="code" href="namespaceeos.html#a1df73defa04d39763089df7faa35a934">print</a>(s , unsigned_64_bit_int, unsigned_128_bit_int, string_as_unsigned_64_bit);</div><div class="line"><span class="comment">// Ouput: Hello World!100000000000000000087654323456abcde</span></div></div><!-- fragment --> 
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
